using Microsoft.Phone.Controls.Maps.AutomationPeers;
using Microsoft.Phone.Controls.Maps.Design;
using System;
using System.ComponentModel;
using System.Device.Location;
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Markup;
namespace Microsoft.Phone.Controls.Maps
{
	[ContentProperty("Content")]
	public sealed class Pushpin : ContentControl
	{
		public static readonly DependencyProperty LocationDependencyProperty = DependencyProperty.Register("Location", typeof(GeoCoordinate), typeof(Pushpin), new PropertyMetadata(new GeoCoordinate(0.0, 0.0), new PropertyChangedCallback(Pushpin.OnLocationChangedCallback)));
		public static readonly DependencyProperty PositionOriginDependencyProperty = DependencyProperty.Register("PositionOrigin", typeof(PositionOrigin), typeof(Pushpin), new PropertyMetadata(new PropertyChangedCallback(Pushpin.OnPositionOriginChangedCallback)));
		[TypeConverter(typeof(LocationConverter))]
		public GeoCoordinate Location
		{
			get
			{
				return (GeoCoordinate)base.GetValue(Pushpin.LocationDependencyProperty);
			}
			set
			{
				base.SetValue(Pushpin.LocationDependencyProperty, value);
			}
		}
		public PositionOrigin PositionOrigin
		{
			get
			{
				return (PositionOrigin)base.GetValue(Pushpin.PositionOriginDependencyProperty);
			}
			set
			{
				base.SetValue(Pushpin.PositionOriginDependencyProperty, value);
			}
		}
		private static void OnLocationChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs eventArgs)
		{
			d.SetValue(MapLayer.PositionProperty, (GeoCoordinate)eventArgs.get_NewValue());
		}
		private static void OnPositionOriginChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs eventArgs)
		{
			d.SetValue(MapLayer.PositionOriginProperty, (PositionOrigin)eventArgs.get_NewValue());
		}
		public Pushpin()
		{
			base.set_DefaultStyleKey(typeof(Pushpin));
		}
		protected override AutomationPeer OnCreateAutomationPeer()
		{
			return new BaseAutomationPeer(this, "Pushpin");
		}
	}
}
